package edu.whut.recursion;
/*
递归求1-5的和
 */
public class RecursionDemo02 {
    public static void main(String[] args) {
        System.out.println(F(5));
    }
    public static int F(int n){
        if(n==1) return 1;
        else return n+F(n-1);
    }
}
